import com.proalias.particles.Emitter;
/**
 * @author Alias Cummins
 */
class com.proalias.particles.SpiralParticle extends MovieClip{
	
	public var vx:Number;
	public var vy:Number;
	public var startX:Number;
	public var master:Emitter;

	public var life : Number;

	public var startT : Number;

	private var startY : Number;

	private var t : Number;

	private var rad : Number;
	
	/*
	 * This is a particle which follows a roughly spiral path, tracing out the sin/cos function with a certain degree of randomness
	 * 
	 */
	public function SpiralParticle(){
	trace("FloatParticle.FloatParticle()");
	};
	
	public function init(x:Number,y:Number,vx:Number,vy:Number,master:Emitter,life:Number) : Void {
		_x = x;
		_y = y;
		startX = x;
		startY = y;
		startT = master.t;
		this.vx = vx;
		this.vy = vy;
		this.master = master;
		this.life = life;
		rad = Math.sin(master.t/100)*Math.random()*300;
	}
	
	public function step() : Void {
		var t:Number = master.t/10;
		
		var newX:Number = startX + (Math.cos(t) *  vx);
		var newY:Number = startY + (Math.sin(t) *  vy);
		startY -= vy;
		_x = newX;
		_y = newY;
		
	}
	
	public function die():Void{
		//trace("FloatParticle.die()");
		removeMovieClip(this);
	}
};